package com.qc.ayouth.shop.dbs.service.system.impl;

import com.qc.ayouth.shop.dbs.entity.TSystemRole;
import com.qc.ayouth.shop.dbs.mapper.TSystemRoleMapper;
import com.qc.ayouth.shop.dbs.service.system.TSystemRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 角色表  服务实现类
 * </p>
 *
 * @author Haojg
 * @since 2020-07-04
 */
@Service
public class TSystemRoleServiceImpl extends ServiceImpl<TSystemRoleMapper, TSystemRole> implements TSystemRoleService {

    @Override
    public List<TSystemRole> getRoleListByIdList(String roleIds) {
        return this.baseMapper.getRoleListByIdList(roleIds);
    }

    @Override
    public Set<String> getRoleSetByIdList(String roleIds) {
        Set<String> roleSet = new HashSet<String>();
        List<TSystemRole> roleList = this.baseMapper.getRoleListByIdList(roleIds);
        for(TSystemRole role : roleList){
            roleSet.add(role.getRoleName());
        }
        return roleSet;
    }
}
